from read import read
from readPdf import Extractor
from readPdf import get_json
import readPdf
import readTravel
import Invoice
import pdfplumber
import re

# # 打开 PDF 文件
# with pdfplumber.open("D:\\费控\\第三方网约车服务公司_阳光出行行程报销单.pdf") as pdf:
#     # 提取第一页文本（假设发票内容在第一页）
#     page = pdf.pages[0]
#     text = page.extract_text()
#     # 使用正则表达式提取发票号码（紧跟"发票号码："后的数字）
#     invoice_pattern = r"发票号码[\s：]*\n\s*([\d]+)"
#     match = re.search(invoice_pattern, text)
#     invoice_number = match.group(1) if match else None
#
#     # 提取开票日期（在"国家税务总局"之后的日期格式）
#     date_pattern = r"([\d]{4}年[\d]{1,2}月[\d]{1,2}日)"
#     match = re.search(date_pattern, text)
#     issue_date = match.group(1) if match else None
#
# print("发票号码:", invoice_number)
# print("开票日期:", issue_date)


# if __name__ == "__main__":
#     file_path = "\\\\192.168.23.74\\tmp\\fileRead\\fileUpload\\1749015362655-发票.pdf"
#     read(file_path)

# print(data)
# with pdfplumber.open(file_path) as pdf:
#     page = pdf.pages[0]
#     words = page.extract_words()
#     tables=page.find_tables()
#     print(words)
#     for table in tables:
#         print(table)

#     print(tables)
